<template lang="pug">
  #app
    div.size
      .ivu-message.goto-200(v-if="isShow")
        .ivu-message-notice
          .ivu-message-notice-content.ivu-message-notice-content-error
            .ivu-message-notice-content-text
              .ivu-message-custom-content.ivu-message-error
                i.ivu-icon.ivu-icon-ios-close-circle 
                span {{showText}}
      router-view(v-if="isRouterAlive")
</template>

<script>
import stroe from '@/store'
export default {
  name: 'App',

  provide () {
    return {
      reload: this.reload
    }
  },

  data () {
    return {
      isRouterAlive: true
    }
  },

  mounted () {
    this.$Message.config({
      top: 200
    })
    // this.$Message.warning({
    //   content: 'uouo反倒是咖啡贺卡积分',
    //   duration: 1000
    // })
  },
  computed: {
    isShow () {
      return !this.$store.state.user.messageCheckAllowLogin.success
    },
    showText () {
      return this.$store.state.user.messageCheckAllowLogin.message
    }
  },

  methods: {
    reload () {
      this.isRouterAlive = false
      this.$nextTick(function () {
        this.isRouterAlive = true
      })
    }
  },
  wacth: {
  }
}
</script>

<style lang="less">
.size{
  width: 100%;
  height: 100%;
}
html,body{
  .size;
  overflow: hidden;
  margin: 0;
  padding: 0;
}
#app {
  .size;
}
.goto-200{
  top: 200px !important;
}
</style>
